package applet;

import bomberman.Game;
import java.util.Hashtable;
import java.io.Serializable;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;

/**
 *
 * @author eirikb
 */
public class BombermanClient extends UnicastRemoteObject implements Client, Serializable {

    private Bomberman bomberman;
    private Bombertest test;

    public BombermanClient(Bomberman bomberman) throws RemoteException {
        this.bomberman = bomberman;
    }

    public BombermanClient(Bombertest test) throws RemoteException {
        this.test = test;
    }

    public void startGame() throws RemoteException {
        System.out.println("startgame");
        bomberman.startGame();
    }

    public void pong() throws RemoteException {
    }

    public void publicChat(String message) throws RemoteException {
        System.out.println("publicchat");
        bomberman.publicChat(message);
    }

    public void updateGameList(Hashtable<String, Game> games) throws RemoteException {
        System.out.println("updategamelist");
        bomberman.updateGameList(games);
    }

    public void addGame(Game game) throws RemoteException {
        System.out.println("addgame");
        bomberman.addGame(game);
    }

    public void removeGame(Game game) throws RemoteException {
        System.out.println("removegtame");
        bomberman.removeGame(game);
    }

    public void updateGame(Game game) throws RemoteException {
        System.out.println("updategame");
        bomberman.updateGame(game);
    }
}
